.class public Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;
.super Lcom/bitauto/autoeasy/BaseListActivity;
.source "SelectCarActivity.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/bitauto/autoeasy/BaseListActivity;",
        "Landroid/widget/AdapterView$OnItemClickListener;",
        "Landroid/view/View$OnClickListener;"
    }
.end annotation


# instance fields
.field BrandList:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Brand;",
            ">;"
        }
    .end annotation
.end field

.field TAG:Ljava/lang/String;

.field private button01:Landroid/widget/Button;

.field private button02:Landroid/widget/Button;

.field private flag:I

.field private listView:Landroid/widget/ListView;

.field private strs:[Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 31
    invoke-direct {p0}, Lcom/bitauto/autoeasy/BaseListActivity;-><init>()V

    .line 38
    const-string v0, "SelectCarActivity"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->TAG:Ljava/lang/String;

    .line 31
    return-void
.end method


# virtual methods
.method public downloadData()V
    .locals 4

    .prologue
    .line 74
    :try_start_0
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;

    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v2

    invoke-virtual {v2}, Landroid/content/res/Resources;->getAssets()Landroid/content/res/AssetManager;

    move-result-object v2

    const-string v3, "brand"

    invoke-virtual {v2, v3}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;

    move-result-object v2

    invoke-static {v2}, Lcom/bitauto/autoeasy/tool/ToolBox;->convertStreamToString(Ljava/io/InputStream;)Ljava/lang/String;

    move-result-object v2

    invoke-direct {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;-><init>(Ljava/lang/String;)V

    .line 75
    .local v0, bParser:Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;
    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;->Paser2Object()Ljava/util/ArrayList;

    move-result-object v2

    iput-object v2, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    .line 79
    .end local v0           #bParser:Lcom/bitauto/autoeasy/selectcar/Object/BrandParser;
    :goto_0
    return-void

    .line 76
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 77
    .local v1, e:Ljava/io/IOException;
    const/4 v2, 0x0

    iput-object v2, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    goto :goto_0
.end method

.method public initView()V
    .locals 1

    .prologue
    .line 60
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->requestWindowFeature(I)Z

    .line 61
    const v0, 0x7f03002c

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->setContentView(I)V

    .line 63
    const v0, 0x7f0b01c6

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button01:Landroid/widget/Button;

    .line 64
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button01:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 65
    const v0, 0x7f0b01c7

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button02:Landroid/widget/Button;

    .line 66
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button02:Landroid/widget/Button;

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 67
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->getListView()Landroid/widget/ListView;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->listView:Landroid/widget/ListView;

    .line 69
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 2
    .parameter "v"

    .prologue
    .line 129
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 142
    :cond_0
    :goto_0
    return-void

    .line 131
    :pswitch_0
    iget v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->flag:I

    const/4 v1, 0x1

    if-ne v0, v1, :cond_0

    .line 132
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->setBrandView()V

    goto :goto_0

    .line 136
    :pswitch_1
    iget v0, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->flag:I

    if-nez v0, :cond_0

    .line 137
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->setPrice()V

    goto :goto_0

    .line 129
    nop

    :pswitch_data_0
    .packed-switch 0x7f0b01c6
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 0
    .parameter "savedInstanceState"

    .prologue
    .line 42
    invoke-super {p0, p1}, Lcom/bitauto/autoeasy/BaseListActivity;->onCreate(Landroid/os/Bundle;)V

    .line 44
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->initView()V

    .line 45
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->setBrandView()V

    .line 47
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 5
    .parameter
    .parameter "view"
    .parameter "position"
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .local p1, parent:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    const/4 v3, 0x1

    const-class v2, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;

    const-string v4, "title"

    .line 112
    iget v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->flag:I

    if-nez v1, :cond_1

    .line 113
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;

    invoke-direct {v0, p0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 114
    .local v0, intent:Landroid/content/Intent;
    const-string v2, "bsid"

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/selectcar/Object/Brand;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/selectcar/Object/Brand;->getId()I

    move-result v1

    invoke-virtual {v0, v2, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    .line 115
    const-string v1, "title"

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/bitauto/autoeasy/selectcar/Object/Brand;

    invoke-virtual {v1}, Lcom/bitauto/autoeasy/selectcar/Object/Brand;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v4, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 116
    const/high16 v1, 0x400

    invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 117
    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->startActivity(Landroid/content/Intent;)V

    .line 125
    .end local v0           #intent:Landroid/content/Intent;
    :cond_0
    :goto_0
    return-void

    .line 118
    :cond_1
    iget v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->flag:I

    if-ne v1, v3, :cond_0

    .line 120
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/bitauto/autoeasy/selectcar/BrandListActivity;

    invoke-direct {v0, p0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 121
    .restart local v0       #intent:Landroid/content/Intent;
    const-string v1, "type"

    add-int/lit8 v2, p3, 0x1

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;I)Landroid/content/Intent;

    move-result-object v1

    const-string v2, "Price"

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 122
    const-string v1, "title"

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->strs:[Ljava/lang/String;

    aget-object v1, v1, p3

    invoke-virtual {v0, v4, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 123
    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->startActivity(Landroid/content/Intent;)V

    goto :goto_0
.end method

.method protected onResume()V
    .locals 2

    .prologue
    .line 51
    sget-object v0, Lcom/bitauto/autoeasy/MainActivity;->mainActivity:Lcom/bitauto/autoeasy/MainActivity;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/MainActivity;->setTitleButtonVisit(Z)V

    .line 52
    invoke-super {p0}, Lcom/bitauto/autoeasy/BaseListActivity;->onResume()V

    .line 53
    return-void
.end method

.method public setBrandView()V
    .locals 3

    .prologue
    .line 82
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    if-nez v1, :cond_0

    .line 83
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->downloadData()V

    .line 84
    :cond_0
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    if-eqz v1, :cond_1

    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    if-lez v1, :cond_1

    .line 85
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandAdapter;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandAdapter;-><init>(Landroid/app/Activity;)V

    .line 86
    .local v0, adapter:Lcom/bitauto/autoeasy/selectcar/Adapter/BrandAdapter;
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->BrandList:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandAdapter;->setList(Ljava/util/ArrayList;)V

    .line 87
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Adapter/BrandAdapter;->setListView(Landroid/widget/ListView;)V

    .line 89
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, v0}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 90
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 94
    .end local v0           #adapter:Lcom/bitauto/autoeasy/selectcar/Adapter/BrandAdapter;
    :goto_0
    const/4 v1, 0x0

    iput v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->flag:I

    .line 95
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button01:Landroid/widget/Button;

    const v2, 0x7f020029

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundResource(I)V

    .line 96
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button02:Landroid/widget/Button;

    const v2, 0x7f02003b

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundResource(I)V

    .line 97
    return-void

    .line 92
    :cond_1
    const v1, 0x7f030016

    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->setContentView(I)V

    goto :goto_0
.end method

.method public setPrice()V
    .locals 4

    .prologue
    .line 100
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    const v2, 0x7f050001

    invoke-virtual {v1, v2}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->strs:[Ljava/lang/String;

    .line 101
    new-instance v0, Landroid/widget/ArrayAdapter;

    const v1, 0x7f03000e

    const v2, 0x7f0b001f

    iget-object v3, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->strs:[Ljava/lang/String;

    invoke-direct {v0, p0, v1, v2, v3}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;II[Ljava/lang/Object;)V

    .line 102
    .local v0, adapter:Landroid/widget/ArrayAdapter;,"Landroid/widget/ArrayAdapter<Ljava/lang/String;>;"
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v1, v0}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 104
    const/4 v1, 0x1

    iput v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->flag:I

    .line 105
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button02:Landroid/widget/Button;

    const v2, 0x7f020029

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundResource(I)V

    .line 106
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/SelectCarActivity;->button01:Landroid/widget/Button;

    const v2, 0x7f02003b

    invoke-virtual {v1, v2}, Landroid/widget/Button;->setBackgroundResource(I)V

    .line 107
    return-void
.end method
